package com.health.ts.service.sysmanage;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.ts.dao.sysmanage.SysAuthorityMapper;
import com.health.ts.dao.sysmanage.SysRoleAuthorityMapper;
import com.health.ts.entity.sysmanage.SysAuthority;
import com.health.ts.entity.sysmanage.SysRoleAuthority;
@Service
public class SysRoleAuthorityService extends ServiceImpl<SysRoleAuthorityMapper, SysRoleAuthority> {
	
	@Autowired
	SysAuthorityMapper sysAuthorityMapper;

	//根据角色查询所有权限
	public List<SysAuthority> selectAuthoritys(List<SysRoleAuthority> list){
		List<SysAuthority> listAuth=new ArrayList<SysAuthority>();
		if(list.size()>0){
			for(SysRoleAuthority m:list){
				SysAuthority auth=sysAuthorityMapper.selectById(m.getAuthority_id());
				listAuth.add(auth);
			}
		}
		return listAuth;
	}
}
